package edu.ucsd.ccdb.tagPopup.dataType;

import java.util.Comparator;

public class NIFOntologyTerm {
	private String name;
	private String label; 
	private String ontoURL;
	private String referenceURL;	// not known most of the time
	
	public NIFOntologyTerm ( String name, String label, String ontoURL ) {
		this.name = name;
		this.label = label;
		this.ontoURL = ontoURL;
	}
	
	public NIFOntologyTerm( String name, String label, String ontoURL, String referenceURL ) {
		this.name = name;
		this.label = label;
		this.ontoURL = ontoURL;
		this.referenceURL = referenceURL;
	}
	
	public NIFOntologyTerm( String label, String url ) {
		this.name = "unknown";
		this.label = label;
		this.ontoURL = url;
	}
	
	public String getReferenceURL() {
		return referenceURL;
	}
	
	public String getName() {
		return name;
	}

	public String getLabel() {
		return label;
	}

	public String getOntoURL() {
		return ontoURL;
	}
	
	public String toString () {
//		return "(" + label + "," + ontoURL + ")";
		return name;
	}
	
	public static class NIFOntologyComparator implements Comparator<NIFOntologyTerm> {

		public int compare(NIFOntologyTerm o1, NIFOntologyTerm o2) {
			
			return o1.getName().toLowerCase().compareTo( o2.getName().toLowerCase() );
		}
		
	}
}
